#!/bin/bash
# set -x
shopt -s expand_aliases
alias config="/usr/bin/git --git-dir=$HOME/dotfiles.git/ --work-tree=$HOME"

function GstIsNull {
	if [ -z $1 ]
	then
		echo "input your parameter"
		exit
	fi
	str=$(config status -s | grep $1)
	if [ -z "$str" ]
	then
		return 0
	elif [ -n "$str" ]
	then
		return 1
	fi
}

function RepoIsEmpty {
	case $1 in
		ibus)
			GstIsNull ibus;;
		vim)
			GstIsNull init.vim;;
		task)
			GstIsNull task;;
		*)
			echo "Usage:RepoIsEmpty [ibus|vim|task|pkm]"
			exit
	esac
}

if RepoIsEmpty $1
then
	echo "the $1 Repo is empty"
else
	echo "the $1 Repo is not empty"
fi
